package com.whiteblue.validator;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

/**
 * Created by WhiteBlue on 15/4/6.
 */
public class EditInfoValidator extends Validator {
    @Override
    protected void validate(Controller controller) {
        this.validateString("feeling", false, 0, 200, "msg", "签名有误");
        this.validateString("location", false, 0, 100, "msg", "地址有误");
    }

    @Override
    protected void handleError(Controller controller) {
        controller.setSessionAttr("info","输入有误");
        controller.redirect("user/myInfo");
    }
}
